<?php

$array_type = array();
$prazdne_pole = array();
foreach ($count_reports as $key => $value) {
    array_push($array_type, $count_reports[$key]['type_id']);
    $prazdne_pole[$count_reports[$key]['type_id']] = $key;
}

echo "<ul>";
for ($i = 0; $i <= 4; $i++) {
    if (in_array($i, $array_type)) {
        $typ = $i;
        $pocet = $count_reports[$prazdne_pole[$i]]['sum(type_id)'] / $count_reports[$prazdne_pole[$i]]['type_id'];
    } else {
        $typ = $i;
        $pocet = 0;
    }
    switch ($typ) {
        case '0' :
            $typ = "udalosti";
            $pocet = $count_reports_all;
            break;
        case '1':
            $typ = "radarov";
            break;
        case '2':
            $typ = "hliadok";
            break;
        case '3':
            $typ = "nehôd";
            break;
        case '4':
            $typ = "mobilných radarov";
            break;
    }
    echo "<li><b>Počet všetkých " . $typ . ": </b>" . $pocet . "</li>";

}
echo "</ul>";
?>


